<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:include flush="true" page="../common/cts.jsp"></jsp:include>
<html>
	<head>
		<title>CTS物流跟踪系统-财务详情</title>
		<link rel="stylesheet" href="${pageContext.request.contextPath}/cts/css/style.css" type="text/css"/>
		<link rel="stylesheet" href="${pageContext.request.contextPath}/cts/css/jNice.css" type="text/css" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/jquery.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/popdiv.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/jquery.bgiframe.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/common.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/searchdata.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/validate.tips.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" >
			var authType="<s:property value="#request.authType" />";
			var verificationId="<s:property value="verification.id"/>"
			var oldEmployeeId="";
			var oldCreateTime="";
			var oldCurrencyId="";
			var currencyArrs;
			
			$(function (){
				//if(有需要结算的款项){
					getPayDetailFee();
				//}
				//if(有几经结算的款项){
					getBillFee();
				//}
				if(verificationId!="" && verificationId!=0){
					oldEmployeeId="<s:property value="verification.employee.id"/>";
					oldCreateTime="<s:date name="verification.createTime" format="yyyy-MM-dd"/>";
					oldCurrencyId="<s:property value="verification.currency.id"/>";
					var allCurrencyToRMB = '<s:property value="#request.allCurrencyToRMB"/>';
					currencyArrs = new Array();
					if(allCurrencyToRMB != ''){
						var arrs = allCurrencyToRMB.split(';');
						for(var i=0; i<arrs.length; i++){
							currencyArrs[arrs[i].split(',')[0]] = arrs[i].split(',')[1];
						}
					}
				}
				var percentNum="<s:property value="#request.percent"/>";
				if(percentNum =="" || percentNum==0 || percentNum==1){
					$("#percentDiv").hide();
				}else{
					$("#percentDiv").html(parseInt(parseFloat(percentNum)*100)+"%");
				}
				$("#baring").css("width",parseInt(percentNum*636));
				setBarPercentPosition();
				/*$("div[class$='checked']").each(function(){
					$(this).click( function () {
						changeChecked(this);
					}); 
				});*/
				$("#typeCondition").find("div[class$='checked']").each(function(){
					$(this).click( function () {
						changeChecked(this);
						if($(this).attr("class")=="checked"){
							$(this).children().val(1); 
						}else{
							$(this).children().val(0); 
						}
						getPayDetailFee();
					}); 
				});
				countMoney();
				var sumBillMoney=0;
				$("#billTab").find("span[name='moneyToRate']").each(function (){
					sumBillMoney+=parseFloat($(this).html());
				});
				$("#sumBillMoney").val(sumBillMoney);
			});
			
			//设置进度条百分比的位置（0%和100%不出现，并且只在系统写死的5个委托项目才出现）
			function setBarPercentPosition(){
				if(verificationId!="" && verificationId!=0){
					var w=$("#baring").css("width");
					var pos=$("#baringDiv").position();
					var pos_x=pos.left;
					var r_w=0;
					if(parseFloat(w)==0){
						$("#baringLeft,#baringRight").css("width","0");
						r_w=-18;
					}else{
						r_w=0;
					}
					var l=parseFloat(w)+parseFloat(pos.left)+parseFloat(r_w);
					$("#percentDiv").css("left",l);
				}
			}
			
			//获取可以结算的款项
			function getPayDetailFee(){
				var personId="<s:property value="verification.employee.id"/>";
				var searchWorkCode=$("#workCode").val();
				if(searchWorkCode=="输入订单号筛选"){
					$("#workCode").val("");
				}
				var searchTypes=$("#type_1").val()+";"+$("#type_2").val()+";"+$("#type_3").val();
				$.ajax({
					type: "POST",
					async:false,
					cache:false,
					url:'${pageContext.request.contextPath}/cts/awardDetailFee',
					data:"personId="+personId+"&searchTypes="+searchTypes+"&workCode="+$("#workCode").val(),
					success:function(data){
						$("#payDetailFeeDiv").html(data);
					}
				});
				$('#workCode').pleaseInput('输入订单号筛选');
				/*$('input[name^="inputMoney"]').each(function(){
					$(this).pleaseInput('请输入');
					$(this).blur(function (){
						var obj=$(this).parent().parent().find("div[class$='checked']");
						if(isNaN($(this).val())){
							$(obj).removeClass("checked");
							$(obj).addClass("unchecked");
						}else{
							$(obj).removeClass("unchecked");
							$(obj).addClass("checked");
						}
						countCurrentFee();
					});
				});
				*/
				$("#payDetailFeeDiv").find("div[class$='checked']").each(function(){
					$(this).click( function () {
						changeChecked(this);
						if($(this).attr("class")=="checked"){
							var obj=$(this).parent().parent().find("td:eq(4)");
							var obj1=$(this).parent().parent().find("td:eq(5)").find("input");
							obj1.val(obj.html());
						}
						countCurrentFee();
					}); 
				});
			}
			
			//获取已经结算的款项
			function getBillFee(){
				$("#billTab").find("div[class$='checked']").each(function(){
					$(this).click( function () {
						changeChecked(this);
					}); 
				});
			}
			
			//进入编辑模式
			function toEditMode(){
				if(authType!=0 && authType!=1){
					alert("抱歉！您没有操作的权限！");
					return;
				}
				$("#verificationDataTr").find('td').each(function(){
					$(this).find('span:eq(0)').hide();
					$(this).find('span:eq(1)').show();
				});
				$("#editLink").hide();
				$("#saveLink").show();
			}
			var preErrorId = [];
			//保存
			function saveVerification(){
				var ispass = true;
				var errorId = [];
				var cardNum = $("#cardNum").val();
				if(cardNum == ''){
					errorId[errorId.length] = "cardNum";
				}
				var employeeId = $("#employeeId").val();
				if(employeeId == ''){
					errorId[errorId.length] = "employee";
				}
				var createTime = $("#createTime").val();
				if(createTime == ''){
					errorId[errorId.length] = "createTime";
				}
				var currency = $("#currency").val();
				if(currency == '' || currency==0){
					errorId[errorId.length] = "currency";
				}
				var toAccountMoney = $("#toAccountMoney").val();
				if(toAccountMoney == '' || toAccountMoney==0 || isNaN(toAccountMoney)){
					errorId[errorId.length] = "toAccountMoney";
				}
				var bankDeductionMoney = $("#bankDeductionMoney").val();
				if(bankDeductionMoney == '' || isNaN(bankDeductionMoney)){
					errorId[errorId.length] = "bankDeductionMoney";
				}
				
				for(var i=0; i<preErrorId.length; i++){
					normalCss(preErrorId[i]);
				}
				for(var i=0; i<errorId.length; i++){
					ispass = false;
					errorCss(errorId[i]);
				}
				preErrorId = errorId;
				
				if(!ispass){
					alert('缺少必填项或输入的值不正确！');
					return;
				}
			
				//修改
				if(verificationId!="" && verificationId!=0){
					if(oldEmployeeId!=$("#employeeId").val() || oldCreateTime!=$("#createTime").val() || oldCurrencyId!=$("#currency").val()){
						$("#sumBillMoney").val(0);
						var ids="(";
						$("#billTab").find("div[class*='checked']").each(function(){
							ids+=$(this).attr("id")+",";
						});
						if(ids!="("){
							var index=ids.lastIndexOf(",");
							ids=ids.substring(0,index);
							ids+=")";
							$("#billIds").val(ids);
							$.ajax({
								type: "POST",
								async:false,
								url:'${pageContext.request.contextPath}/cts/deleteAwardVerificationBill',
								data:$("#myForm").serialize(),
								success:function(data){
									if(data!=0){
										alert("撤销结算失败！请稍后再试！");
									}
								}
							});
						}	
						
					}
				}
				$.ajax({
					type: "POST",
					async:false,
					url:'${pageContext.request.contextPath}/cts/saveOrEditAwardVerification',
					data:$("#myForm").serialize(),
					success:function(data){
						window.location.href="awardDetail?id="+data;
					}
				});
			}
			
			//删除
			function delVerification(){
				if(authType!=0 && authType!=1){
					alert("抱歉！您没有操作的权限！");
					return;
				}
				if(confirm("您确定要删除吗？")){
					$("#sumBillMoney").val(0);
						var ids="(";
						$("#billTab").find("div[class*='checked']").each(function(){
							ids+=$(this).attr("id")+",";
						});
						if(ids!="("){
							var index=ids.lastIndexOf(",");
							ids=ids.substring(0,index);
							ids+=")";
							$("#billIds").val(ids);
							$.ajax({
								type: "POST",
								async:false,
								url:'${pageContext.request.contextPath}/cts/deletePayVerificationBill',
								data:$("#myForm").serialize(),
								success:function(data){
									if(data!=0){
										alert("撤销结算失败！请稍后再试！");
									}
								}
							});
						}	
				
					$.ajax({
						type: "POST",
						url:'${pageContext.request.contextPath}/cts/deleteVerification',
						data:$("#myForm").serialize(),
						success:function(data){
							if(data==1){
								alert("删除失败！");
							}else{
								window.opener.location.reload();
								window.close();
							}
						}
					});
				}
			}
			
			//计算应结算金额
			function countMoney(){
				var toAccountMoney=$("#toAccountMoney").val();
				var bankDeductionMoney=$("#bankDeductionMoney").val();
				if(toAccountMoney!="" && bankDeductionMoney!=""){
					$("#money").val(parseFloat(toAccountMoney)-parseFloat(bankDeductionMoney));
					$("#moneySpan").html(parseFloat(toAccountMoney)-parseFloat(bankDeductionMoney));
				}
			}
			
			//提交结算
			function saveVerificationBill(){
				if(authType!=0 && authType!=1){
					alert("抱歉！您没有操作的权限！");
					return;
				}
				var ids="(";
				$("#payDetailFeeDiv").find("div[class='checked']").each(function(){
					ids+=$(this).attr("id")+",";
				});
				if(ids=="("){
					alert("请至少选择一项!");
				}else{	
					var index=ids.lastIndexOf(",");
					ids=ids.substring(0,index);
					ids+=")";
					$("#workFeeIds").val(ids);
					$.ajax({
						type: "POST",
						url:'${pageContext.request.contextPath}/cts/saveAwardVerificationBill',
						data:$("#myForm").serialize(),
						success:function(data){
							if(data==0){
								window.location.reload();
							}else{
								alert("结算失败！请稍后再试！");
							}
						}
					});
				}
			}
			
			//撤销结算
			function deleteVerificationBill(){
				if(authType!=0 && authType!=1){
					alert("抱歉！您没有操作的权限！");
					return;
				}
				var ids="(";
				$("#billTab").find("div[class='checked']").each(function(){
					ids+=$(this).attr("id")+",";
				});
				if(ids=="("){
					alert("请至少选择一项!");
				}else{	
					var index=ids.lastIndexOf(",");
					ids=ids.substring(0,index);
					ids+=")";
					$("#billIds").val(ids);
					$.ajax({
						type: "POST",
						async:false,
						url:'${pageContext.request.contextPath}/cts/deleteAwardVerificationBill',
						data:$("#myForm").serialize(),
						success:function(data){
							if(data==0){
								window.location.reload();
							}else{
								alert("撤销结算失败！请稍后再试！");
							}
						}
					});
				}
			}
			
			//统计本次核销总金额
			function countCurrentFee(){
				var currency="<s:property value="verification.currency.id"/>";
				var rate1=currencyArrs[currency];
				var totalMoney=0;
				$("#payDetailFeeDiv").find("div[class='checked']").parent().parent().each(function(){
					var _currency=$(this).find("td:eq(3)").find("input[name^='currencyHidId']").val();
					var _money=$(this).find("td:eq(5)").find("input[name^='inputMoney_']").val();
					var rate2 = currencyArrs[_currency];
					if(_money && _money != '' && _currency && _currency != '' && rate2 && rate2 != ''){
						totalMoney += _money * rate2 / rate1;
					}
				});
				$("#payDetailFeeDiv").find("tr:gt(0)").find("td:last").html("");
				$("#payDetailFeeDiv").find("div[class='checked']:last").parent().parent().find("td:last").html("<s:property value="verification.currency.type"/>"+" "+totalMoney.toFixed(2));
				
			}
			
			//归档
			function changeVerificationStatus(){	
				if(authType!=0 && authType!=1){
					alert("抱歉！您没有操作的权限！");
					return;
				}
				var flag;
				if($("#isSettle").val()==1){
					flag=0;
				}else{
					flag=1;
				}
				$.ajax({
					type: "POST",
					async:false,
					url:'${pageContext.request.contextPath}/cts/changeVerificationStatus',
					data:"vid="+$("#verificationId").val()+"&isSettle="+flag,
					success:function(data){
						if(data==0){
							window.location.reload();
						}else{
							alert("归档失败！请稍后再试！");
						}
					}
				});
			}
			
			$(window).scroll( function() {
			 		var scrollTop=document.documentElement.scrollTop || document.body.scrollTop;
			 		var scrollLeft=document.documentElement.scrollLeft || document.body.scrollLeft;
			 		if(navigator.userAgent.indexOf("MSIE 6.0")>0)   
					{
						$("#detail_scroll_bar").css("top",document.documentElement.clientHeight-parseInt($("#detail_scroll_bar").css("height"))+document.documentElement.scrollTop);
					}else{
			 			$("#detail_scroll_bar").css("bottom",0-scrollTop);
			 		}
			 		setBarPercentPosition();
			 }); 
			 $(window).resize(function(){
				  	var scrollTop=document.documentElement.scrollTop || document.body.scrollTop;
			 		var scrollLeft=document.documentElement.scrollLeft || document.body.scrollLeft;
			 		if(navigator.userAgent.indexOf("MSIE 6.0")>0)   
					{
						$("#detail_scroll_bar").css("top",document.documentElement.clientHeight-parseInt($("#detail_scroll_bar").css("height"))+document.documentElement.scrollTop);
					}else{
			 			$("#detail_scroll_bar").css("bottom",0-scrollTop);
			 		}
			 		setBarPercentPosition();
			});   
		</script>
		<style>
			.fee_edit{background:url(${pageContext.request.contextPath}/cts/images/fee_edit.png) no-repeat center; width:20px; height: 20px; border: 0;
				float:left;margin-right: 5px; margin-left:6px; color:#869717;border:0px solid red;}
			.fee_ok{background:url(${pageContext.request.contextPath}/cts/images/fee_ok.png) no-repeat center; width:20px; height: 20px; border: 0;
				float:left;margin-right: 5px; margin-left:6px; color:#869717;border:0px solid red;}
			.fee_status{background:url(${pageContext.request.contextPath}/cts/images/fee_status.png) no-repeat center; width:20px; height: 20px; border: 0;
				float:left; margin-right: 5px;color:#869717;}
			.fee_del{background:url(${pageContext.request.contextPath}/cts/images/fee_del.png) no-repeat center; width:20px; height: 20px; border: 0;
				float:left; color:#869717;}
		</style>
	</head>
	<jsp:include page="../im/importIm.jsp?switchFlag=true"></jsp:include>
	<body style="text-align: left;" background="${pageContext.request.contextPath}/cts/images/detail_bg.png">
	<form id="myForm" name="myFrom" action="">
		<input type="hidden" id="isSettle" name="isSettle" value="<s:property value="verification.isSettle"/>"/>
		<input type="hidden" name="teamData" value="<s:property value="#request.teamData"/>"/>
		<input type="hidden" id="verificationId" name="verification.id" value="<s:property value="verification.id"/>"/>
		<input type="hidden" name="verification.type" value="2"/>
		<input type="hidden" id="notWrittenOffmoney" name="verification.notWrittenOffmoney" value=""/>
		<input type="hidden" id="workFeeIds" name="workFeeIds" value=""/>
		<input type="hidden" id="billIds" name="billIds" value=""/>
		<input type="hidden" id="sumBillMoney" name="sumBillMoney" value="" />
		
		<div class="main_div" style="color:#686868">
			<s:if test="verification==null || verification.id==null || verification.id==0">
			<%-- 新增 --%>
			<div style="padding:10px;border:1px dashed #383838;text-align:center;margin-top:0px;width:930px;background-color: #fff">
				<div class="payDetail_title_div">奖励明细</div>
				<table width="930px" class="tab2" cellpadding="0" cellspacing="0" border="0" style="font-weight: bold;font-size:12px;table-layout: fixed;">
					
						<tr style="background-color: #E8ECD3;">
						    <td width="110px">凭证号</td>
						    <td width="135px">收款人</td>
						    <td width="95px">支付日期</td>
						    <td width="65px">币种</td>
						    <td width="85px">支付金额</td>
						    <td width="20px" style="background-color: #F9F1CD;" rowspan="2" >—</td>
						    <td width="85px">银行手续费</td>
						    <td width="20px" style="background-color: #F9F1CD;" rowspan="2" >=</td>
						    <td width="85px">应结算金额</td>
						    <td width="135px">备注</td>
						    <td width="83px">操作</td>
					    </tr>
					
					  	<tr id="verificationDataTr" style="background-color: #FFFCF3;">
						    <td>
							    <input id="cardNum" type="text" name="verification.cardNum" value="<s:property value="#request.newCardNum"/>" class="input_normal"/>
						    </td>
						    <td>
					    		<input type="text"  id="employee" name="employee" 
									onkeyup="seachDataByKeyword('cts/searchEmployeeBykeyword.action?type=1',this.value,'employee','employeeId',0,200);" class="input_normal"/>
								<input type="hidden" value="<s:property value="verification.employee.id"/>" id="employeeId" name="employeeId"/>
						    </td>
						    <td>
					    		<input type="text" id="createTime" name="verification.createTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="input_normal" />
						    </td>
						    <td>
					    		<select class="select_normal" id="currency" name="verification_currency">
									<option value="0">请选择</option>
									<s:iterator value="%{#request.currencys}">
										<option value="<s:property value="id"/>" ><s:property value="type"/></option>
									</s:iterator>
								</select>
						    </td>
						    <td style="color:#f54e05">
				    			<input id="toAccountMoney" name="verification.toAccountMoney" type="text" onblur="countMoney()"  class="input_normal"/>
						    </td>
						    <td>
				    			<input id="bankDeductionMoney" name="verification.bankDeductionMoney" type="text"  onblur="countMoney()"  class="input_normal"/>
						    </td>
						    <td style="color:#f54e05">
						    	<span id="moneySpan"></span>
				    			<input id="money" name="verification.money" type="hidden"/>
						    </td>
						    <td>
				    			<input type="text" name="verification.description" class="input_normal"/>
						    </td>
						    <td>
								<a id="saveLink" style="margin-left:30px;" class="fee_ok" href="javascript:saveVerification()"></a>
							</td>
					  	</tr>
				</table>
			</div>
			<%-- 新增 --%>
			</s:if>
			<s:else>
			<%--详情页面 --%>
			<%-- 奖励明细 --%>
			<div style="padding:10px;border:1px dashed #383838;text-align:center;margin-top:0px;width:930px;background-color: #fff">
				<div class="payDetail_title_div">奖励明细</div>
				<table width="930px" class="tab2" cellpadding="0" cellspacing="0" border="0" style="font-weight: bold;font-size:12px;table-layout: fixed;">
					
						<tr style="background-color: #E8ECD3;">
						    <td width="110px">凭证号</td>
						    <td width="135px">收款人</td>
						    <td width="95px">支付日期</td>
						    <td width="65px">币种</td>
						    <td width="85px">支付金额</td>
						    <td width="20px" style="background-color: #F9F1CD;" rowspan="2" >—</td>
						    <td width="85px">银行手续费</td>
						    <td width="20px" style="background-color: #F9F1CD;" rowspan="2" >=</td>
						    <td width="85px">应结算金额</td>
						    <td width="135px">备注</td>
						    <td width="83px">操作</td>
					    </tr>
					
					  	<tr id="verificationDataTr" style="background-color: #FFFCF3;">
						    <td>
						    	<span>
						    		<s:property value="verification.cardNum"/>
						    	</span>
						    	<span style="display:none">
							    	<input type="text" id="cardNum" name="verification.cardNum" value="<s:property value="verification.cardNum"/>" class="input_normal"/>
						    	</span>
						    </td>
						    <td>
						    	<span>
						    		<s:property value="verification.employee.nickname"/>
						    	</span>
						    	<span style="display:none">
						    		<input type="text"  id="employee" name="employee" value="<s:property value="verification.employee.nickname"/>"
										onkeyup="seachDataByKeyword('cts/searchEmployeeBykeyword.action?type=1',this.value,'employee','employeeId',0,200);" class="input_normal"/>
									<input type="hidden" value="<s:property value="verification.employee.id"/>" id="employeeId" name="employeeId"/>
						    	</span>
						    	
						    </td>
						    <td>
						    	<span>
						    		<s:date name="verification.createTime" format="yyyy-MM-dd" />
						    	</span>
						    	<span style="display:none">
						    		<input type="text" id="createTime" name="verification.createTime" value="<s:date name="verification.createTime" format="yyyy-MM-dd" />" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="input_normal" />
						    	</span>
						    </td>
						    <td>
						    	<span>
						    		<s:property value="verification.currency.type"/>
						    	</span>
						    	<span style="display:none">
						    		<select class="select_normal" id="currency" name="verification_currency">
										<option value="0">请选择</option>
										<s:iterator value="%{#request.currencys}">
											<option value="<s:property value="id"/>" <s:if test="verification.currency.id==id">selected</s:if>><s:property value="type"/></option>
										</s:iterator>
									</select>
						    	</span>
						    </td>
						    <td style="color:#f54e05">
						    	<span>
						    		<s:property value="%{getText('format.float1',{verification.toAccountMoney})}"/>
						    	</span>
						    	<span style="display:none">
					    			<input id="toAccountMoney" name="verification.toAccountMoney" type="text" onblur="countMoney()" value="<s:property value="%{getText('format.float1',{verification.toAccountMoney})}"/>" class="input_normal"/>
						    	</span>
						    </td>
						    <td>
						    	<span>
						    		<s:property value="%{getText('format.float1',{verification.bankDeductionMoney})}"/>
						    	</span>
						    	<span style="display:none">
					    			<input id="bankDeductionMoney" name="verification.bankDeductionMoney" type="text"  onblur="countMoney()" value="<s:property value="%{getText('format.float1',{verification.bankDeductionMoney})}"/>" class="input_normal"/>
						    	</span>
						    </td>
						    <td style="color:#f54e05">
						    	<span>
						    		<s:property value="%{getText('format.float1',{verification.money})}"/>
						    	</span>
						    	<span style="display:none">
					    			<input id="money" type="text" name="verification.money" style="background-color: white;" disabled="disabled" value="<s:property value="%{getText('format.float1',{verification.money})}"/>" class="input_normal"/>
						    	</span>
						    </td>
						    <td>
						    	<span>
						    		<s:property value="verification.description"/>
						    	</span>
						    	<span style="display:none">
					    			<input type="text" name="verification.description" value="<s:property value="verification.description"/>" class="input_normal"/>
						    	</span>
						    </td>
						    <td>
								<s:if test="verification.isSettle==1">
						    		<a style="color:#537f16" href="javascript:changeVerificationStatus()">撤销归档</a>
						    	</s:if>
						    	<s:else>
									<a id="editLink" class="fee_edit" href="javascript:toEditMode()"></a>
									<a id="saveLink" class="fee_ok" style="display:none" href="javascript:saveVerification()"></a>
									<a class="fee_status" href="javascript:changeVerificationStatus()"></a>
									<a class="fee_del" href="javascript:delVerification();"></a>
								</s:else>
							</td>
					  	</tr>
				</table>
			</div>
			<%-- 奖励明细 --%>
			<%-- 已结算明细 --%>
			<div style="float:left;padding:10px;border:1px dashed #383838;border-top:0px;text-align:center;margin-top:0px;width:930px;background-color: #fff">
				<div style="float:left;width:30%;line-height:36px;text-align:left;">
					<s:if test="verification.isSettle==0 && #request.emp.type!=1 && #request.authType!=2">
						<a href="javascript:deleteVerificationBill()" style="padding-left:5px;color:#537f16;font-size:13px;font-weight:bold;">撤销结算</a>
					</s:if>
					<s:else>
						&nbsp;
					</s:else>
				</div>
				<div style="float:left;width:40%" class="payDetail_title_div">已结算明细</div>
				<table id="billTab" align="left" width="625px" class="tab3" cellpadding="0" cellspacing="0" border="0" style="font-weight: bold;font-size:12px;table-layout: fixed;">
					<tr style="background-color: #E8ECD3;">
				      <td width="30px">&nbsp;</td>
				      <td width="135px">订单号</td>
				      <td width="135px">委托人</td>
				      <td width="105px">奖励金额</td>
				      <td width="105px">结算奖励</td>
				      <td width="115px">结算人</td>
				    </tr>
				   <s:iterator value="billList">
				   		 <tr style="background-color: #ececec">
					      <td style="background-color: #FFFCF3;padding-left:6px;"><div id="<s:property value="id" />" class="unchecked"></div></td>
					      <td><s:property value="workFee.work.workCode"/></td>
					      <td><s:property value="workFee.work.client1.nickname"/></td>
					      <td style="color:<s:if test="workFee.type==0">#435ec2</s:if><s:else>#f54e05</s:else>"><s:property value="workFee.currency.type"/> <s:property value="currentWrittenOffMoney"/></td>
					      <td style="color:<s:if test="workFee.type==0">#435ec2</s:if><s:else>#f54e05</s:else>"><s:property value="verification.currency.type"/> <s:property value="%{getText('format.float1',{currentWrittenOffMoneyToRate})}"/><span style="display:none" name="moneyToRate"><s:property value="currentWrittenOffMoneyToRate"/></span></td>
					      <td><s:property value="employee.nickname"/></td>
					    </tr>
				   </s:iterator>
				    
				</table>
			</div>
			<%-- 已结算明细 --%>
			<%-- 进度条 --%>
			<div style="float:left;padding:10px;padding-top:30px;padding-bottom:30px;text-align:center;margin-top:0px;width:930px;">
				<table cellpadding="0" cellspacing="0" border="0" width="930" style="table-layout: fixed;text-align:center;font-weight: bold;font-size:14px;">
					<tr>
						<td width="130px" style="font-size:15px;color:#f54e05"><s:property value="verification.currency.type"/> <s:property value="%{getText('format.float',{#request.writtenOfmoney})}"/></td>
						<td width="670px">
							<div style="text-align:left;background: url('${pageContext.request.contextPath}/cts/images/detail_main.png') no-repeat;width:667px;height:21px;padding-top:3px;">
								<div id="baringDiv" style="position:absolute; z-index:2px;padding-left:5px;width:660px;overflow: hidden;border:0px solid red">
									<img id="baringLeft" src="${pageContext.request.contextPath}/cts/images/detail_bar_ing_left.png" style="float:left" height="16px"/>
									<img id="baring" src="${pageContext.request.contextPath}/cts/images/detail_bar_ing.png" style="float:left" height="16px"/>
									<img id="baringRight" src="${pageContext.request.contextPath}/cts/images/detail_bar_ing_right.png" style="float:left" height="16px"/>
								</div>
							</div>
							<div id="percentDiv" style="font-size:12px;font-weight:normal;position:absolute;z-index:4px;margin-left:8px;color:#fff;background: url('${pageContext.request.contextPath}/cts/images/detail_bar_percent_bg.png') no-repeat;width:27px;height:19px;line-height:23px;text-align:center"></div>
						</td>
						<td width="130px" style="font-size:15px;color:#f54e05"><s:property value="verification.currency.type"/> <s:property value="%{getText('format.float',{verification.notWrittenOffmoney})}"/></td>
					</tr>
					<tr>
						<td>(已结算金额)</td>
						<td>
							
						</td>
						<td>(未结算金额)</td>
					</tr>
				</table>
			</div>
			<%-- 进度条 --%>
			<%-- 请选择您需要结算的款项 显示的条件（没归档的，不是访客，有编辑功能的）--%>
			<s:if test="verification.isSettle==0 && #request.authType!=-1 && #request.authType!=2">
			<div style="float:left;padding:10px;border:1px dashed #383838;text-align:center;margin-top:0px;width:930px;background-color: #fff">
				<div style="float:left;width:774px;border:0px solid red">
					<div style="float:left;width:186px;line-height:36px;text-align:left;border:0px solid red">
						<a href="javascript:saveVerificationBill();" style="float:left;padding-left:5px;color:#537f16;font-size:13px;font-weight:bold;">提交结算</a>
						<div style="display:none;padding-top:3px;border:0px solid red;width:139px;margin-top:6px;margin-right:9px;_margin-right:4px;height:21px;float:right;text-align:left;background: url('${pageContext.request.contextPath}/cts/images/detail_search_bg.png') no-repeat;">
							<div style="float:left;border:0px solid red;width:25px;height:16px;cursor:pointer" onclick="getPayDetailFee()"></div><input id="workCode" name="workCode" type="text" value="" style="font-size:12px;font-weight:bold;color:#828C95;background:transparent;padding-top:1px;border:0;width:100px;height:14px;line-height: 14px" />
						</div>
					</div>
					<div style="float:left;width:580px;border:0px solid red" class="payDetail_title_div">请选择您需要结算的款项</div>
					<div id="payDetailFeeDiv" style="float:left;width:703px;border:0px solid red">
						
					</div>
				</div>
				<div id="typeCondition" style="float:left;width:150px;text-align:left;border:0px solid red;padding-top:10px;font-weight:bold;">
					<div style="float:left;width:100%;">
						<div style="float:left;" class="checked"><input id="type_1" name="type1" type="hidden" value="1"/></div>
						<div style="float:left;">&nbsp;已归档的订单</div>
					</div>
					<div style="float:left;width:100%;padding-top:5px;">
						<div style="float:left;" class="checked"><input id="type_2" name="type2" type="hidden" value="1"/></div>
						<div style="float:left;">&nbsp;应收已收的订单</div>
					</div>
					<div style="float:left;width:100%;padding-top:5px;">
						<div style="float:left;" class="unchecked"><input id="type_3" name="type3" type="hidden" value="0"/></div>
						<div style="float:left;">&nbsp;应付已付的订单&nbsp;&nbsp;&nbsp;&nbsp;</div>
					</div>
				</div>
			</div>
			</s:if>
			<%-- 请选择您需要结算的款项 --%>			
			<%-- 详情页面 --%>
			</s:else>
			<div style="float:left;height:50px;border:0px solid red;width:930px">&nbsp;</div>
		</div>
		<div id="detail_scroll_bar" class="detail_scroll_bar">
			<div class="nowrap" style="font-weight: bold;font-size:14px;text-align:left;margin:0 auto;width:950px;">
				<div class="detail_scroll_bar_per" style="width:80px;text-align:left">>> 结算团队 ：</div>
				<s:iterator value="#request.vtlist" status="sta">
					<s:if test="#cts_userid==employee.user.id">
						<div class="detail_scroll_bar_per"><s:if test="auth==0">创建</s:if><s:elseif test="auth==1">编辑</s:elseif><s:else>浏览</s:else> / <s:if test="employee.nickname==null || employee.nickname==''"><s:property value="employee.user.userName"/></s:if><s:else><s:property value="employee.nickname"/></s:else></div>
					</s:if>
					<s:else>
						<div class="detail_scroll_bar_per"><s:if test="auth==0">创建</s:if><s:elseif test="auth==1">编辑</s:elseif><s:else>浏览</s:else> / <a href="javascript:openImDialog('popdiv_inner_imChat', '${pageContext.request.contextPath}/cts/toListIm?uid=<s:property value="employee.user.id"/>')"><s:if test="employee.nickname==null || employee.nickname==''"><s:property value="employee.user.userName"/></s:if><s:else><s:property value="employee.nickname"/></s:else></a></div>
					</s:else>
				</s:iterator>
			</div>
		</div>
		</form>
	</body>
</html>

   
   
   
   
   
   
   
   
   